<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div class="main-container">
    <div class="body-container">
      <!-- left -->
      <div class="left-container">
        <!-- 每日进港流量 -->
        <div class="day-flow">
          <div class="title">每日进港流量</div>
          <div class="single-data-item">
            <img class="icon-container" src="../../assets/visual/车.png" alt srcset />
            <span class="today">
              <span class="tab-val">0</span>
              <span class="tab-title">今日</span>
            </span>
            <span class="yestoday">
              <span class="tab-val">0</span>
              <span class="tab-title">昨日</span>
            </span>
          </div>
          <div class="single-data-item">
            <img class="icon-container" src="../../assets/visual/人.png" alt srcset />
            <span class="today">
              <span class="tab-val">0</span>
              <span class="tab-title">今日</span>
            </span>
            <span class="yestoday">
              <span class="tab-val">0</span>
              <span class="tab-title">昨日</span>
            </span>
          </div>
        </div>
        <!-- 每日告警分布 -->
        <div class="day-warning">
          <div class="title">每日告警分布</div>
          <div class="charts-container">
            <div class="echarts-1" ref="pieContainer1"></div>
            <div class="echarts-content">
              <div class="total-item" v-for="(item, index) in totalWarningList_1" :key="index">
                <span :class="['circle', `type-${index + 1}`]"></span>
                <span class="camera-name">{{ item.name }}</span>
                <span class="total-num">{{ data.dayWarning[item.name] || 0 }}</span>
              </div>
            </div>
          </div>
          <div class="charts-container">
            <div class="echarts-2" ref="pieContainer2"></div>
            <div class="echarts-content">
              <div class="total-item" v-for="(item, index) in totalWarningList_2" :key="index">
                <span :class="['circle', `type-${index + 1}`]"></span>
                <span class="camera-name">{{ item.name }}</span>
                <span class="total-num">{{ data.dayWarning[item.name] || 0 }}</span>
              </div>
            </div>
          </div>
        </div>
        <!-- 设备状态 -->
        <div class="day-state">
          <div class="title">设备状态</div>
          <div class="content">
            <div class="content-item">
              <span class="title">摄像头</span>
              <div class="content-container">
                <img src="../../assets/png/摄像头.png" alt srcset />
                <div class="tab-item">
                  <span class="tab-value" style="color:rgba(24, 190, 107, 1)">
                    {{ equipmentState.camera?.normal || 0
                    }}
                  </span>
                  <span class="tab-title-1">正常</span>
                </div>
                <div class="tab-item">
                  <span class="tab-value" style="color:rgba(243, 63, 63, 1)">
                    {{ equipmentState.camera?.abnormal || 0
                    }}
                  </span>
                  <span class="tab-title-2">异常</span>
                </div>
              </div>
            </div>
            <div class="content-item">
              <span class="title">红外边界</span>
              <div class="content-container">
                <img src="../../assets/png/红外边界.png" alt srcset />
                <div class="tab-item">
                  <span class="tab-value" style="color:#C9CDD4">--</span>
                  <!-- {{ data.infrared.normal }} -->
                  <span class="tab-title-1">正常</span>
                </div>
                <div class="tab-item">
                  <span class="tab-value" style="color:#C9CDD4">--</span>
                  <!-- {{ data.infrared.abnormal }} -->
                  <span class="tab-title-2">异常</span>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- 摄像头 -->
        <div class="day-camera">
          <div class="title">前五告警摄像头</div>
          <div class="pillar-container" ref="pillarContainer"></div>
        </div>
      </div>
      <!-- center -->
      <!-- 9560  4955 -->
      <div class="center-container">
        <div class="map-container">
          <svg
            ref="mapContainer"
            class="svgMap"
            viewBox="0 0 2188  1486"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            xmlns:xlink="http://www.w3.org/1999/xlink"
            :style="`transform:scale(${data.scale}) translate(${data.x}px,${data.y}px);cursor:${data.cursor};`"
          >
            <image :xlink:href="require('../../assets/visual/map.png')
              " />
            <!-- 摄像头 -->
            <image
              v-show="!data.hotMap"
              :id="item.id"
              :class="[`${data.selectedCamera === item.id ? 'selected' : 'unselected'}`]"
              v-for="(item, index) in options"
              :width="66 / 1.5"
              :height="40 / 1.5"
              :key="index"
              :x="item.x"
              :y="item.y"
              :state="item.state"
              @click="handleChangeCamera(item.id)"
              :style="`cursor:pointer;transform: rotate(${item.rotate}deg);transform-origin: center;transform-box: fill-box;`"
              :xlink:href="require(`../../assets/png/icon-camera-${item.id === data.selectedCamera ? 'selected' : (item.state === '1' ? 'default' : 'danger')}.png`)
                "
            />
            <!-- 模块1 -->
            <g transform="translate(690,-50) scale(.7)" v-show="data.hotMap">
              <image
                v-if="data.model1 > 20"
                x="100"
                y="100"
                :xlink:href="require('@/assets/png/热力图-绿.png')
                "
              />
              <image
                v-if="data.model1 >= 50"
                x="150"
                y="150"
                :xlink:href="require('@/assets/png/热力图-黄.png')
                "
              />
              <image
                v-if="data.model1 >= 100"
                x="200"
                y="200"
                :xlink:href="require('@/assets/png/热力图-红.png')
                "
              />
            </g>
            <!-- 模块2 -->
            <g transform="translate(710,500) scale(.8)" v-show="data.hotMap">
              <image
                v-if="data.model2 > 20"
                x="100"
                y="100"
                :xlink:href="require('@/assets/png/热力图-绿.png')
                "
              />
              <image
                v-if="data.model2 >= 50"
                x="150"
                y="150"
                :xlink:href="require('@/assets/png/热力图-黄.png')
                "
              />
              <image
                v-if="data.model2 >= 100"
                x="200"
                y="200"
                :xlink:href="require('@/assets/png/热力图-红.png')
                "
              />
            </g>
            <!-- 模块3 -->
            <g transform="translate(400,1000) scale(0.6)" v-show="data.hotMap">
              <image
                v-if="data.model3 > 20"
                x="100"
                y="100"
                :xlink:href="require('@/assets/png/热力图-绿.png')
                "
              />
              <image
                v-if="data.model3 >= 50"
                x="150"
                y="150"
                :xlink:href="require('@/assets/png/热力图-黄.png')
                "
              />
              <image
                v-if="data.model3 >= 100"
                x="200"
                y="200"
                :xlink:href="require('@/assets/png/热力图-红.png')
                "
              />
            </g>
            <!-- 模块4 -->
            <g transform="translate(1000,1050) scale(0.6)" v-show="data.hotMap">
              <image
                v-if="data.model4 > 20"
                x="100"
                y="100"
                :xlink:href="require('@/assets/png/热力图-绿.png')
                "
              />
              <image
                v-if="data.model4 >= 50"
                x="150"
                y="150"
                :xlink:href="require('@/assets/png/热力图-黄.png')
                "
              />
              <image
                v-if="data.model4 >= 100"
                x="200"
                y="200"
                :xlink:href="require('@/assets/png/热力图-红.png')
                "
              />
            </g>
            <!-- 模块5 -->
            <g transform="translate(1200,350) scale( 1.1 1.4 )" v-show="data.hotMap">
              <image
                v-if="data.model5 > 20"
                x="100"
                y="100"
                :xlink:href="require('@/assets/png/热力图-绿.png')
                "
              />
              <image
                v-if="data.model5 >= 50"
                x="150"
                y="150"
                :xlink:href="require('@/assets/png/热力图-黄.png')
                "
              />
              <image
                v-if="data.model5 >= 100"
                x="200"
                y="200"
                :xlink:href="require('@/assets/png/热力图-红.png')
                "
              />
            </g>
            <!-- 模块6 -->
            <g transform="translate(1400,-50) scale(1 .7)" v-show="data.hotMap">
              <image
                v-if="data.model6 > 20"
                x="100"
                y="100"
                :xlink:href="require('@/assets/png/热力图-绿.png')
                "
              />
              <image
                v-if="data.model6 >= 50"
                x="150"
                y="150"
                :xlink:href="require('@/assets/png/热力图-黄.png')
                "
              />
              <image
                v-if="data.model6 >= 100"
                x="200"
                y="200"
                :xlink:href="require('@/assets/png/热力图-红.png')
                "
              />
            </g>
          </svg>
          <!-- tools -->
          <div class="action-container">
            <!-- <span class="icon-group">
              <span class="icon-item">
                <img class="add" src="../../assets/icon-add.png" alt srcset />
              </span>
              <span class="split-line"></span>
              <span class="icon-item">
                <img class="subtract" src="../../assets/icon-subtract.png" alt srcset />
              </span>
            </span>-->
            <span class="icon-wrapper" @click="openHotmap">
              <el-tooltip
                class="box-item"
                effect="dark"
                :content="`${data.hotMap ? '关闭热力图' : '开启热力图'}`"
                placement="top-start"
              >
                <img :src="require(`../../assets/icon-热力图${data.hotMap ? '开' : '关'}.png`)" alt />
              </el-tooltip>
            </span>
          </div>
        </div>
        <div class="statistic-container">
          <div class="statistical-header">
            <span class="statistical-title">实时趋势</span>
            <span class="indicate-line-1"></span>
            <span class="today-title">今日数据</span>
            <span class="indicate-line-2"></span>
            <span class="yestoday-title">昨日数据</span>
          </div>
          <div class="echarts-container" ref="categoryContainer"></div>
        </div>
      </div>
      <!-- right -->
      <div class="right-container">
        <!-- 实时监控 -->
        <div class="day-realVideo">
          <div class="title">实时监控</div>
          <div class="video-container fullscreen-toggle" @click="handleScaleVideo">
            <img :src="data.cameraUrl" alt srcset ref="fullscreen" />
          </div>
          <el-select
            v-model="data.selectedCamera"
            class="video-select"
            placeholder="请选择摄像头"
            size="large"
            @change="handleChangeSingleCamera"
          >
            <el-option
              v-for="(item, index) in cameraList"
              :key="index"
              :label="`${item.id}-${item.label}`"
              :value="item.id"
            />
          </el-select>
        </div>
        <!-- 告警处理 -->
        <div class="day-doing">
          <div class="title">告警处理</div>
          <div class="total">
            <img class="doing-speed" src="../../assets/visual/处理速度.png" alt srcset />
            <div class="total-num">
              <span class="title-1">
                待处理
                <a>{{ alaramStatusNum.untreated }}</a>
              </span>
              <span class="title-2">平均处理时常 34分钟</span>
            </div>
          </div>
          <div class="list-container">
            <div
              class="list-item"
              v-for="(item, index) in (detect_info_list.detect_info_list || []).filter(e => e.is_read === 'False')"
              :key="index"
            >
              <div class="single-item-1">
                <span class="item-title-1">{{ item.camera_name }}-{{ item.camera_position }}</span>
                <span class="item-title-2 action" @click="handleCheck(item)">查看</span>
              </div>
              <div class="single-item-2">
                <span class="item-title-1">{{ item.check_type }}</span>
                <span class="item-title-2">{{ item.time }}</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 查看告警详情 -->
    <el-dialog v-model="data.dialogVisible" v-if="data.dialogVisible" title="告警详情" width="908px">
      <div class="dialog-content">
        <div class="title">
          <img src="../../assets/png/Warning.png" alt srcset />
          {{ data.selectedTableData.camera_name }}-{{ data.selectedTableData.camera_position }}
          {{ data.selectedTableData.check_type }}
        </div>
        <div class="body">
          <!-- <video ref="videoRef" style="width:100%"></video> -->
          <video
            v-if="data.selectedTableData.video"
            class="video-js"
            controls
            preload="auto"
            width="100%"
            :poster="data.selectedTableData.image"
            data-setup="{}"
          >
            <source :src="data.selectedTableData.video" type="video/mp4" />
          </video>
        </div>
        <div class="footer">
          <span class="sub-title">处理意见</span>
          <el-select
            v-model="data.isRead"
            placeholder="Select"
            size="large"
            style="width: 588px;margin-right:18px;"
          >
            <el-option label="已确认处理" :value="true" />
          </el-select>
          <span class="sub-title">备注</span>
          <el-input v-model="data.remark" placeholder="可以在这里填写处理方意见或方式（选填）"></el-input>
        </div>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <!-- <el-button @click="dialogVisible = false">暂不处理</el-button> -->
          <el-button @click="handleCancelFnc">暂不处理</el-button>
          <el-button type="primary" @click="handleUpdate">确认处理</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import * as Echarts from "echarts";
import {
  _options,
  dayMap,
  cameraList,
  totalWarningList_1,
  totalWarningList_2
} from "@/assets/data/index.js";
import { reactive, onMounted, onUnmounted, ref, watch, computed } from "vue";
import dayjs from "dayjs";
import http from "@/api/index.js";
import {
  pieOption,
  categoryOptions,
  pillarOption
} from "./components/_statistical.js";
import { useStore } from "vuex";

import { ElMessage } from "element-plus";

const store = useStore();

const cameraState = computed(() =>
  store.getters.getSorketData("get_device_status")
);

const equipmentState = computed(() =>
  store.getters.getSorketData("get_device_status_number")
);
const alaramStatusNum = computed(() =>
  store.getters.getSorketData("get_alarm_status_number")
);
const detect_info_list = computed(() =>
  store.getters.getSorketData("get_single_camera_detect_info")
);
watch(
  () => detect_info_list,
  curr => {
    console.log("detect_info_list", curr);
  }
);

const options = computed(() => {
  const _arr = (cameraState.value?.cameraState || []).filter(
    e =>
      [
        "C1",
        "C3",
        "C5",
        "C8",
        "C9",
        "C18",
        "C26",
        "C27",
        "C28",
        "C29",
        "C30",
        "C31"
      ].indexOf(e.id) > -1
  );
  const arr = _options.map(e => {
    const index = _arr.findIndex(el => el.id === e.id);
    if (index > -1) {
      e.state = _arr[index].state;
    }

    return e;
  });
  return arr;
});

// 前五告警摄像头
const pillarContainer = ref(null);
const chartsPillar = ref(null);

// 实时趋势
const categoryContainer = ref(null);
const chartsCategory = ref(null);

// 告警分布
const pieContainer1 = ref(null);
const chartsPie1 = ref(null);

const pieContainer2 = ref(null);
const chartsPie2 = ref(null);

const interval = ref(null);
const warningInterval = ref(null);
const isFullScrean = ref(false);
watch(
  () => isFullScrean.value,
  curr => {
    if (curr) {
      data.cameraUrl = `http://183.6.88.43:8012/Safe/video_feed?camera_name=${data.selectedCamera}&width=${window.innerWidth}&height=${window.innerHeight}`;
    } else {
      data.cameraUrl = `http://183.6.88.43:8012/Safe/video_feed?camera_name=${data.selectedCamera}&width=616&height=462`;
    }
  }
);
const data = reactive({
  selectedTableData: {},
  dialogVisible: false,
  hotMap: false,
  dayWarning: {},
  camera: {},
  warningList: {},
  selectedCamera: "C1",
  detect_info_list: [],
  all_count: 0,
  processed: 0,
  untreated: 0,
  cameraUrl:
    "http://183.6.88.43:8012/Safe/video_feed?camera_name=C1&width=616&height=462",

  realTime: "",
  listData: [1, 2, 3, 5, 6, 7, 8, 9, 10], //告警处理

  model1: 0,
  model2: 0,
  model3: 0,
  model4: 0,
  model5: 0,
  model6: 0,
  scale: 1,
  x: 0,
  y: 0,
  cursor: "default",
  fullScreen: false,
  lastClientX: 0,
  lastClientY: 0,
  remark: "",
  isRead: true
});
watch(
  () => data.dialogVisible,
  curr => {
    if (!curr) {
      data.remark = "";
    }
  }
);
watch(
  () => data.selectedCamera,
  curr => {
    data.cameraUrl = `http://183.6.88.43:8012/Safe/video_feed?camera_name=${curr.toUpperCase()}&width=616&height=462`;
  }
);

const warningList = computed(() =>
  store.getters.getSorketData("get_current_detect_accuracy")
);
watch(warningList, curr => {
  if (chartsCategory.value) {
    const { today, yesterday } = curr.warningList;
    const _option = JSON.parse(JSON.stringify(categoryOptions));
    _option.series[0].data = today;
    _option.series[1].data = yesterday;
    chartsCategory.value.setOption(_option);
  }
});
const fullscreen = ref(null);
/**
 * 放大实时视频
 */
const handleScaleVideo = () => {
  let docElement = fullscreen.value;
  let requestFullScreen =
    docElement.requestFullscreen ||
    docElement.mozRequestFullScreen ||
    docElement.webkitRequestFullScreen ||
    docElement.msRequestFullscreen;

  isFullScrean.value = !isFullScrean.value;

  if (
    !document.fullscreenElement &&
    !document.mozFullScreenElement &&
    !document.webkitFullscreenElement &&
    !document.msFullscreenElement
  ) {
    // 当前不是全屏状态，进入全屏
    requestFullScreen.call(docElement);
  } else if (document.exitFullscreen) {
    // 当前处于全屏状态，退出全屏
    document.exitFullscreen();
  } else if (document.mozCancelFullScreen) {
    document.mozCancelFullScreen();
  } else if (document.webkitExitFullscreen) {
    document.webkitExitFullscreen();
  } else if (document.msExitFullscreen) {
    document.msExitFullscreen();
  }
};
// 柱状图
const initpillar = () => {
  chartsPillar.value = new Echarts.init(pillarContainer.value);
  chartsPillar.value.setOption(pillarOption);
};
// 折线图
const initCategory = () => {
  chartsCategory.value = new Echarts.init(categoryContainer.value);
  chartsCategory.value.setOption(categoryOptions);
};
// 饼图
const initpie = () => {
  chartsPie1.value = new Echarts.init(pieContainer1.value);
  chartsPie1.value.setOption(pieOption);

  chartsPie2.value = new Echarts.init(pieContainer2.value);
  chartsPie2.value.setOption(pieOption);
};
const handleChangeCamera = cameraId => {
  data.selectedCamera = cameraId;
};
/**
 * 切换摄像头
 * @param {*} e
 */
const handleChangeSingleCamera = e => {
  // console.log(e)
  setSingleCamera();
};
const setSingleCamera = async () => {
  try {
    const _data = await http({
      name: "set_camera_number",
      data: {
        camera_name: data.selectedCamera,
        timestamp: new Date().valueOf()
      }
    });
    if (_data.data === "Success") {
      console.log("change camera success");
    }
  } catch (error) {
    console.error(error);
  }
};
const getWarningNumber = () => {
  http({
    name: "getStatistic",
    _url: `http://183.6.88.43:8007/Safe/get_alarm_24h`
  })
    .then(res => {
      if (!res.data) {
        return;
      }
      data.dayWarning = res.data?.alarm_number;

      // totalWarningList_1 人员闯入 未穿反光衣 未戴安全帽 人员下车
      const _option1 = JSON.parse(JSON.stringify(pieOption));
      _option1.series[0].data = [
        { name: "人员闯入", value: res.data?.alarm_number?.["人员闯入"] || 0 },
        {
          name: "未穿反光衣",
          value: res.data?.alarm_number?.["未穿反光衣"] || 0
        },
        {
          name: "未戴安全帽",
          value: res.data?.alarm_number?.["未戴安全帽"] || 0
        },
        { name: "人员下车", value: res.data?.alarm_number?.["人员下车"] || 0 }
      ];
      chartsPie1.value.setOption(_option1);
      // totalWarningList_2 车辆超速 车辆逆行
      const _option2 = JSON.parse(JSON.stringify(pieOption));
      _option2.series[0].data = [
        { name: "车辆超速", value: res.data?.alarm_number?.["车辆超速"] || 0 },
        {
          name: "车辆逆行",
          value: res.data?.alarm_number?.["未穿反光衣"] || 0
        },
        {
          name: "车辆违规进入",
          value: res.data?.alarm_number?.["车辆违规进入"] || 0
        }
      ];
      chartsPie2.value.setOption(_option2);

      // 五告警摄像头
      const arr = [];
      for (const key in res.data?.alarm_sorted_dict) {
        const element = res.data?.alarm_sorted_dict[key];
        arr.push({
          name: key,
          value: element
        });
      }
      arr.forEach(el => {
        if (["C1", "C26"].indexOf(el.name.toUpperCase()) > -1) {
          data.model1 += Number(el.value);
        } else if (["C27", "C18"].indexOf(el.name.toUpperCase()) > -1) {
          data.model2 += Number(el.value);
        } else if (["C28"].indexOf(el.name.toUpperCase()) > -1) {
          data.model3 += Number(el.value);
        } else if (["C9"].indexOf(el.name.toUpperCase()) > -1) {
          data.model4 += Number(el.value);
        } else if (
          ["C8", "C9", "C30", "C31"].indexOf(el.name.toUpperCase()) > -1
        ) {
          data.model5 += Number(el.value);
        } else if (["C3", "C5"].indexOf(el.name.toUpperCase()) > -1) {
          data.model6 += Number(el.value);
        }
      });
      data.totalWarningList = arr.sort((a, b) => a - b).slice(0, 5);
      const _option3 = JSON.parse(JSON.stringify(pillarOption));
      _option3.xAxis.data = arr
        .sort((a, b) => a - b)
        .slice(0, 5)
        .map(e => e.name);
      _option3.series[0].data = arr
        .sort((a, b) => a - b)
        .slice(0, 5)
        .map(e => e.value);
      chartsPillar.value.setOption(_option3);
    })
    .catch(err => {
      console.log(err);
    });
};
/**
 * 查看告警信息
 */
const handleCheck = param => {
  data.selectedTableData = param;
  data.dialogVisible = !data.dialogVisible;
};

// 暂不处理
const handleCancelFnc = () => {
  data.dialogVisible = false;
  data.selectedTableData = {};
};
/**
 * 发表意见
 */
const handleUpdate = async () => {
  if (!data.remark) {
    return ElMessage.warning("请输入处理意见！");
  }
  const res = await http({
    name: "updateInfo",
    data: {
      info: [{
        token: data.selectedTableData.token,
        is_read: "True",
        remark: data.remark
      }]
    }
  });

  if (res.data.code === 20) {
    ElMessage.success("意见提交成功！");
    data.dialogVisible = false;
    data.remark = "";
    data.selectedTableData = {};
  } else {
    ElMessage.error("提交失败！");
  }
};
onMounted(() => {
  initpillar();
  initpie();
  initCategory();
  getWarningNumber();
  setSingleCamera();
  warningInterval.value = setInterval(() => {
    getWarningNumber();
  }, 4000);

  data.currPath = sessionStorage.getItem("path") || "/main";
  interval.value = setInterval(() => {
    const date = dayjs().format("YYYY-MM-DD");
    const day = dayjs().day();
    const time = dayjs().format("HH:mm:ss");
    data.realTime = `${date} 星期${dayMap[day]} ${time}`;
  });
});
const openHotmap = () => {
  data.hotMap = !data.hotMap;
};
onUnmounted(() => {
  clearInterval(interval.value);
  clearInterval(warningInterval.value);
});
</script>

<style lang="less">
.main-container {
  // position: absolute;
  // left: 0;
  // right: 0;
  // bottom: 0;
  // top: 0;
  background: rgba(2, 9, 53, 1);

  .back-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
  }

  .header-container {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 85px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;

    .back-image-header {
      width: 100%;
    }

    .time-container {
      text-align: center;
      font-size: 16px;
      font-weight: 500;
      color: #ffffff;
    }

    .router-container {
      height: 54px;
      margin: 0 200px;
      position: absolute;
      background: transparent;
      left: 0;
      right: 0;
      bottom: 0;
      top: 0;
      display: flex;
      align-items: center;
      justify-content: center;

      .left1,
      .left3 {
        margin-right: 42px;
      }

      .active-router {
        filter: opacity(1);
      }

      .router-item {
        filter: opacity(0.8);
        cursor: pointer;
        color: #ffffff;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;

        img {
          width: 14px;
          height: 14px;
          margin-right: 10px;
        }
      }

      .split-item {
        flex: 1;
      }
    }
  }

  .body-container {
    position: absolute;
    left: 0;
    top: 110px;
    bottom: 0;
    right: 0;
    // background: red;
    display: flex;
    padding: 0 30px;

    .center-container {
      margin: 0 32px 16px 32px;
      flex: 1;
      display: flex;
      flex-direction: column;

      .map-container {
        flex: 1;
        margin-bottom: 16px;
        position: relative;

        img {
          width: 100%;
          height: 100%;
        }

        .action-container {
          position: absolute;
          right: 16px;
          bottom: 20px;

          .icon-group {
            width: 40px;
            height: 80px;
            background: #273648;
            border-radius: 8px;
            opacity: 0.8;
            display: flex;
            flex-direction: column;

            .icon-item {
              flex: 1;
              display: flex;
              align-items: center;
              justify-content: center;

              .add {
                cursor: pointer;
                width: 16px;
                height: 16px;
              }

              .subtract {
                cursor: pointer;
                width: 16px;
                height: 2px;
              }
            }

            .split-line {
              width: 40px;
              height: 1px;
              background: rgba(255, 255, 255, 0.1);
            }
          }

          .icon-wrapper {
            cursor: pointer;
            margin-top: 12px;
            width: 40px;
            height: 40px;
            background: #273648;
            border-radius: 8px;
            opacity: 0.8;
            display: flex;
            align-items: center;
            justify-content: center;

            img {
              width: 16px;
              height: 16px;
            }
          }
        }
      }

      .statistic-container {
        padding: 8px 12px;
        width: -webkit-fill-available;
        height: 500px;
        background: rgba(0, 113, 188, 0.3);
        border-radius: 8px;
        display: flex;
        flex-direction: column;

        .echarts-container {
          width: 100%;
          height: 100%;
        }

        .statistical-header {
          display: flex;
          align-items: center;

          .statistical-title {
            font-size: 16px;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.95);
            line-height: 22px;
            background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
          }

          .indicate-line-1,
          .indicate-line-2 {
            display: inline-block;
            width: 9px;
            height: 1px;
          }

          .indicate-line-1 {
            margin: 0 8px 0 48px;
            background: rgba(0, 204, 181, 1);
          }

          .indicate-line-2 {
            margin: 0 8px 0 24px;
            background: rgba(14, 117, 250, 1);
          }

          .today-title,
          .yestoday-title {
            width: 60px;
            height: 17px;
            font-size: 12px;
            font-weight: 400;
            color: rgba(255, 255, 255, 0.6);
          }
        }
      }
    }

    .left-container,
    .right-container {
      width: 350px;
      // background: red;
      overflow-y: scroll;
      overflow-x: hidden;

      &::-webkit-scrollbar {
        display: none;
      }

      .day-flow {
        width: 350px;
        height: 202px;
        background-image: url("../../assets/visual/进港流量.png");
        background-size: 350px 100%;
        padding: 9px 16px;
        display: flex;
        flex-direction: column;
        background-repeat: no-repeat;
        margin-bottom: 24px;

        .title {
          width: 96px;
          height: 22px;
          font-size: 16px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          color: rgba(255, 255, 255, 0.95);
          line-height: 22px;
          background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
        }

        .single-data-item {
          padding-left: 16px;
          flex: 1;
          display: flex;
          align-items: center;

          .icon-container {
            width: 52px;
            height: 52px;
          }

          .today {
            margin-left: 46px;
          }

          .yestoday {
            margin-left: 56px;
          }

          .today,
          .yestoday {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;

            .tab-val {
              font-size: 24px;
              font-weight: 500;
              color: rgba(255, 255, 255, 0.95);
            }

            .tab-title {
              font-size: 14px;
              font-weight: 400;
              color: #1890ff;
            }
          }
        }
      }

      .day-warning {
        width: -webkit-fill-available;
        height: 328px;
        background-image: url("../../assets/visual/每日告警.png");
        background-size: 350px 100%;
        padding: 9px 16px;
        display: flex;
        flex-direction: column;
        background-repeat: no-repeat;
        margin-bottom: 24px;

        .charts-container {
          flex: 1;
          display: flex;

          .echarts-1,
          .echarts-2 {
            width: 140px;
            height: 140px;
            margin-right: 18px;
          }

          .echarts-content {
            flex: 1;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            flex-direction: column;

            .total-item {
              margin-bottom: 8px;
              display: flex;
              align-items: center;
              justify-content: flex-start;
              width: -webkit-fill-available;

              .circle {
                width: 12px;
                height: 12px;
                border-radius: 12px;
                margin-right: 12px;
              }

              .type-1 {
                background: rgba(232, 147, 0, 1);
              }

              .type-2 {
                background: rgba(0, 204, 181, 1);
              }

              .type-3 {
                background: rgba(14, 117, 250, 1);
              }

              .type-4 {
                background: rgba(2, 56, 217, 1);
              }

              .camera-name {
                flex: 1;
                font-size: 14px;
                font-weight: 400;
                color: #ffffff;
              }

              .total-num {
                margin-right: 24px;
                font-size: 16px;
                font-weight: 500;
                color: #ffffff;
              }
            }
          }
        }

        .title {
          width: 96px;
          height: 22px;
          font-size: 16px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          color: rgba(255, 255, 255, 0.95);
          line-height: 22px;
          background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
        }
      }

      .day-state {
        margin-bottom: 24px;
        width: -webkit-fill-available;
        height: 162px;
        background-image: url("../../assets/visual/设备状态.png");
        background-size: 350px 100%;
        padding: 9px 16px;
        display: flex;
        flex-direction: column;
        background-repeat: no-repeat;

        .title {
          width: 96px;
          height: 22px;
          font-size: 16px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          color: rgba(255, 255, 255, 0.95);
          line-height: 22px;
          background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          margin-bottom: 18px;
        }

        .content {
          display: flex;

          .content-item {
            flex: 1;

            & > .title {
              font-size: 14px;
              margin-bottom: 12px;
              display: inline-flex;
            }

            &:first-child {
              margin-right: 12px;
            }

            .content-container {
              padding: 0 12px;
              display: flex;
              align-items: center;
              justify-content: center;
              height: 68px;
              background: rgba(24, 144, 255, 0.2);
              border-radius: 4px;

              & > img {
                width: 24px;
                height: 24px;
              }

              .tab-item {
                display: flex;
                flex-direction: column;
                flex: 1;
                align-items: center;
                justify-content: center;

                .tab-title-1 {
                  font-size: 14px;
                  font-weight: 400;
                  color: #1890ff;
                }

                .tab-title-2 {
                  font-size: 14px;
                  font-weight: 400;
                  color: rgba(243, 63, 63, 1);
                }
              }
            }
          }
        }
      }

      .day-camera {
        margin-bottom: 24px;
        width: -webkit-fill-available;
        height: 189px;
        background-image: url("../../assets/visual/前五告警摄像头.png");
        background-size: 350px 100%;
        padding: 9px 16px;
        display: flex;
        flex-direction: column;
        background-repeat: no-repeat;

        .title {
          width: 96px;
          height: 22px;
          font-size: 16px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          color: rgba(255, 255, 255, 0.95);
          line-height: 22px;
          background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          margin-bottom: 18px;
        }

        .pillar-container {
          width: 100%;
          height: 100%;
        }
      }

      .day-realVideo {
        margin-bottom: 24px;
        width: -webkit-fill-available;
        height: 352px;
        background-image: url("../../assets/visual/实时监控.png");
        background-size: 350px 100%;
        padding: 9px 16px;
        display: flex;
        flex-direction: column;
        background-repeat: no-repeat;

        .title {
          width: 96px;
          height: 22px;
          font-size: 16px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          color: rgba(255, 255, 255, 0.95);
          line-height: 22px;
          background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          margin-bottom: 16px;
        }

        .video-container {
          width: -webkit-fill-available;
          height: 243px;
          // background: red;
          margin-bottom: 12px;
          border-radius: 6px;

          & > img {
            width: 100%;
            height: 100%;
          }
        }

        .video-select {
          width: -webkit-fill-available;
        }
      }

      .day-doing {
        margin-bottom: 24px;
        width: -webkit-fill-available;
        height: 576px;
        background-image: url("../../assets/visual/告警处理.png");
        background-size: 350px 100%;
        padding: 9px 16px;
        display: flex;
        flex-direction: column;
        background-repeat: no-repeat;

        .title {
          width: 96px;
          height: 22px;
          font-size: 16px;
          font-family: PingFangSC, PingFang SC;
          font-weight: 500;
          color: rgba(255, 255, 255, 0.95);
          line-height: 22px;
          background: linear-gradient(90deg, #bee9ff 0%, #56acff 100%);
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
          margin-bottom: 24px;
        }

        .total {
          display: flex;

          .doing-speed {
            width: 130px;
            height: 74px;
            margin-right: 24px;
          }

          .total-num {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: flex-start;

            .title-1 {
              flex: 1;
              font-size: 14px;
              font-weight: 400;
              color: #ffffff;

              & > a {
                margin-left: 24px;
                font-size: 24px;
                font-weight: 500;
                color: rgba(255, 255, 255, 0.95);
              }
            }

            .title-2 {
              flex: 1;
              font-size: 14px;
              font-weight: 400;
              color: #1890ff;
              line-height: 3;
            }
          }
        }

        .list-container {
          margin-top: 24px;
          flex: 1;

          &::-webkit-scrollbar {
            display: none;
          }

          overflow-x: hidden;
          overflow-y: scroll;
          width: -webkit-fill-available;

          .list-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0 18px;

            border-radius: 12px;

            &:not(:last-child) {
              margin-bottom: 24px;
            }

            height: 53px;
            background: linear-gradient(
              90deg,
              rgba(255, 28, 28, 0.2) 0%,
              rgba(255, 46, 46, 0) 100%
            );
            border: 1px solid;
            border-image: linear-gradient(
                90deg,
                rgba(242, 82, 0, 1),
                rgba(225, 83, 0, 0.4)
              )
              1 1;

            .single-item-1 {
              display: flex;
              width: -webkit-fill-available;

              .item-title-1 {
                flex: 1;
                font-size: 14px;
                font-weight: 500;
                color: #ffffff;
              }

              .action {
                font-size: 12px;
                font-weight: 500;
                color: #1890ff;
                cursor: pointer;
              }
            }

            .single-item-2 {
              display: flex;
              width: -webkit-fill-available;

              .item-title-1 {
                flex: 1;
                font-size: 12px;
                color: #f33f3f;
              }

              .item-title-2 {
                font-size: 12px;
                font-weight: 400;
                color: #ffffff;
              }
            }
          }
        }
      }
    }
  }
}

.el-select--large .el-select__wrapper {
  background: rgba(255, 255, 255, 0.09);
}

.el-select__placeholder {
  color: rgba(255, 255, 255, 0.95);
}

.el-popper.is-light {
}

.dialog-content {
  .title {
    padding: 0 13px;
    // width: 859px;
    height: 40px;
    background: #ffece8;
    border-radius: 8px;
    border: 1px solid #ffccc7;
    display: flex;
    align-items: center;
    margin-bottom: 16px;

    img {
      width: 14px;
      height: 14px;
      margin-right: 9px;
    }
  }

  .body {
    width: -webkit-fill-available;
    // height: 645px;
  }

  .footer {
    margin-top: 12px;
    display: flex;
    align-items: center;

    .sub-title {
      word-break: keep-all;
      margin-right: 16px;
      font-size: 14px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.88);
    }
  }
}

.el-dialog {
  background-color: rgba(49, 62, 99, 1) !important;
}

.el-dialog__title {
  width: 64px !important;
  height: 24px !important;
  font-size: 16px !important;
  font-family: PingFangSC, PingFang SC !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.88) !important;
  line-height: 24px !important;
}
</style>